#ifndef __MYSQL_CMD_H__
#define __MYSQL_CMD_H__

//in package head
const CmdInfo pkgCmdInfo[]={
	{"Sleep", 			false},
  	{"Quit",			true},
  	{"Init DB",			true},
  	{"Query",			true},
  	{"Field List",		true},
  	{"Create DB",		true},
  	{"Drop DB",			false},
  	{"Refresh",			false},
  	{"Shutdown",		false},	
  	{"Statistics",		false},
  	{"Processlist",		false},
  	{"Connect",			false},
  	{"Kill",			false},
  	{"Debug",			false},
  	{"Ping",			true},
  	{"Time",			false},
  	{"Delayed insert",	false},
  	{"Change user",		true},
  	{"Binlog Dump",		false},
  	{"Table Dump",		false},
  	{"Connect Out",		false},
  	{"Register Slave",	false},
  	{"Prepare",			false},	
  	{"Execute",			false},
  	{"Long Data",		false},
  	{"Close stmt",		false},
  	{"Reset stmt",		false},
  	{"Set option",		true},
  	{"Fetch",			false},
  	{"Daemon",			false},
  	{"ErrorCmd",  		false},// Last command number
};

const char* retDesc[] =
{
	"OK      ",
	"E_IGNORE",
	"E_DROP  ",
	"E_SWITCH",
};

const char* myStatusDesc[] = 
{
	"CLOSED...",
	"REQ  CONNECT",
	"RESP HANDSHAKE",
	"REQ  AUTH",
	"RESP AUTH",
	"REQ  QUERY",
	"RESP QUERY",
};

const CmdInfo sqlCmdInfo[] = 
{
	{"SQLCOM_SELECT",				true},
	{"SQLCOM_CREATE_TABLE",			true},
	{"SQLCOM_CREATE_INDEX",			true},
	{"SQLCOM_ALTER_TABLE",			false},
	{"SQLCOM_UPDATE",				true},
	{"SQLCOM_INSERT",				true},
	{"SQLCOM_INSERT_SELECT",		true},	
	{"SQLCOM_DELETE",				true},	
	{"SQLCOM_TRUNCATE",				false},	
	{"SQLCOM_DROP_TABLE",			false},		
	{"SQLCOM_DROP_INDEX",			true},		
	{"SQLCOM_SHOW_DATABASES",		true},	
	{"SQLCOM_SHOW_TABLES",			true},	
	{"SQLCOM_SHOW_FIELDS",			true},	
	{"SQLCOM_SHOW_KEYS",			true},	
	{"SQLCOM_SHOW_VARIABLES",		true},	
	{"SQLCOM_SHOW_STATUS",			true},	
	{"SQLCOM_SHOW_ENGINE_LOGS",		true},	
	{"SQLCOM_SHOW_ENGINE_STATUS",	true},		
	{"SQLCOM_SHOW_ENGINE_MUTEX",	true},	
	{"SQLCOM_SHOW_PROCESSLIST",		true},	
	{"SQLCOM_SHOW_MASTER_STAT",		false},	
	{"SQLCOM_SHOW_SLAVE_STAT",		false},	
	{"SQLCOM_SHOW_GRANTS",			false},	
	{"SQLCOM_SHOW_CREATE",			true},	
	{"SQLCOM_SHOW_CHARSETS",		true},		
	{"SQLCOM_SHOW_COLLATIONS",		true},	
	{"SQLCOM_SHOW_CREATE_DB",		true},	
	{"SQLCOM_SHOW_TABLE_STATUS",	true},		
	{"SQLCOM_SHOW_TRIGGERS",		true},	
	{"SQLCOM_LOAD",					false},	
	{"SQLCOM_SET_OPTION",			true},	
	{"SQLCOM_LOCK_TABLES",			true},	
	{"SQLCOM_UNLOCK_TABLES",		true},	
	{"SQLCOM_GRANT",				false},	
	{"SQLCOM_CHANGE_DB",			true},	
	{"SQLCOM_CREATE_DB",			true},	
	{"SQLCOM_DROP_DB",				false},	
	{"SQLCOM_ALTER_DB",				true},	
	{"SQLCOM_REPAIR",				false},	
	{"SQLCOM_REPLACE",				true},	
	{"SQLCOM_REPLACE_SELECT",		true},			
	{"SQLCOM_CREATE_FUNCTION",		true},		
	{"SQLCOM_DROP_FUNCTION",		false},		
	{"SQLCOM_REVOKE",				true},	
	{"SQLCOM_OPTIMIZE",				true},	
	{"SQLCOM_CHECK",				true},	
	{"SQLCOM_ASSIGN_TO_KEYCACHE",	true},		
	{"SQLCOM_PRELOAD_KEYS",			true},	
	{"SQLCOM_FLUSH",				true},	
	{"SQLCOM_KILL",					true},	
	{"SQLCOM_ANALYZE",				true},	
	{"SQLCOM_ROLLBACK",				true},	
	{"SQLCOM_ROLLBACK_TO_SAVEPOINT",true},			
	{"SQLCOM_COMMIT",				true},	
	{"SQLCOM_SAVEPOINT",			true},	
	{"SQLCOM_RELEASE_SAVEPOINT",	true},		
	{"SQLCOM_SLAVE_START",			false},	
	{"SQLCOM_SLAVE_STOP",			false},	
	{"SQLCOM_BEGIN",				true},	
	{"SQLCOM_LOAD_MASTER_TABLE",	false},		
	{"SQLCOM_CHANGE_MASTER",		false},		
	{"SQLCOM_RENAME_TABLE",			true},	
	{"SQLCOM_BACKUP_TABLE",			true},	
	{"SQLCOM_RESTORE_TABLE",		true},	
	{"SQLCOM_RESET",				true},	
	{"SQLCOM_PURGE",				true},	
	{"SQLCOM_PURGE_BEFORE",			true},		
	{"SQLCOM_SHOW_BINLOGS",			true},	
	{"SQLCOM_SHOW_OPEN_TABLES",		true},	
	{"SQLCOM_LOAD_MASTER_DATA",		false},	
	{"SQLCOM_HA_OPEN",				true},		
	{"SQLCOM_HA_CLOSE",				true},	
	{"SQLCOM_HA_READ",				true},	
	{"SQLCOM_SHOW_SLAVE_HOSTS",		false},	
	{"SQLCOM_DELETE_MULTI",			true},	
	{"SQLCOM_UPDATE_MULTI",			true},	
	{"SQLCOM_SHOW_BINLOG_EVENTS",	true},	
	{"SQLCOM_SHOW_NEW_MASTER",		true},	
	{"SQLCOM_DO",					true},	
	{"SQLCOM_SHOW_WARNS",			true},	
	{"SQLCOM_EMPTY_QUERY",			true},	
	{"SQLCOM_SHOW_ERRORS",			true},	
	{"SQLCOM_SHOW_COLUMN_TYPES",	true},	
	{"SQLCOM_SHOW_STORAGE_ENGINES",	true},	
	{"SQLCOM_SHOW_PRIVILEGES",		true},			
	{"SQLCOM_HELP",					true},	
	{"SQLCOM_CREATE_USER",			false},	
	{"SQLCOM_DROP_USER",			false},	
	{"SQLCOM_RENAME_USER",			false},	
	{"SQLCOM_REVOKE_ALL",			true},	
	{"SQLCOM_CHECKSUM",				true},	
	{"SQLCOM_CREATE_PROCEDURE",		true},	
	{"SQLCOM_CREATE_SPFUNCTION",	true},		
	{"SQLCOM_CALL",					true},	
	{"SQLCOM_DROP_PROCEDURE",		false},	
	{"SQLCOM_ALTER_PROCEDURE",		true},	
	{"SQLCOM_ALTER_FUNCTION",		true},	
	{"SQLCOM_SHOW_CREATE_PROC",		true},	
	{"SQLCOM_SHOW_CREATE_FUNC",		true},	
	{"SQLCOM_SHOW_STATUS_PROC",		true},	
	{"SQLCOM_SHOW_STATUS_FUNC",		true},	
	{"SQLCOM_PREPARE",				true},	
	{"SQLCOM_EXECUTE",				true},	
	{"SQLCOM_DEALLOCATE_PREPARE",	true},	
	{"SQLCOM_CREATE_VIEW",			true},	
	{"SQLCOM_DROP_VIEW",			true},	
	{"SQLCOM_CREATE_TRIGGER",		true},	
	{"SQLCOM_DROP_TRIGGER",			true},	
	{"SQLCOM_XA_START",				true},	
	{"SQLCOM_XA_END",				true},	
	{"SQLCOM_XA_PREPARE",			true},	
	{"SQLCOM_XA_COMMIT",			true},	
	{"SQLCOM_XA_ROLLBACK",			true},	
	{"SQLCOM_XA_RECOVER",			true},		
	{"SQLCOM_SHOW_PROC_CODE",		true},	
	{"SQLCOM_SHOW_FUNC_CODE",		true},	
	{"SQLCOM_ALTER_TABLESPACE",		true},	
	{"SQLCOM_INSTALL_PLUGIN",		true},	
	{"SQLCOM_UNINSTALL_PLUGIN",		true},	
	{"SQLCOM_SHOW_AUTHORS",			true},	
	{"SQLCOM_BINLOG_BASE64_EVENT",	true},		
	{"SQLCOM_SHOW_PLUGINS",			true},	
	{"SQLCOM_SHOW_CONTRIBUTORS",	true},		
	{"SQLCOM_CREATE_SERVER",		true},	
	{"SQLCOM_DROP_SERVER",			false},	
	{"SQLCOM_ALTER_SERVER",			true},	
	{"SQLCOM_CREATE_EVENT",			true},	
	{"SQLCOM_ALTER_EVENT",			true},	
	{"SQLCOM_DROP_EVENT",			true},	
	{"SQLCOM_SHOW_CREATE_EVENT",	true},		
	{"SQLCOM_SHOW_EVENTS",			true},	
	{"SQLCOM_SHOW_CREATE_TRIGGER",	true},		
	{"SQLCOM_ALTER_DB_UPGRADE",		true},	
	{"SQLCOM_SHOW_PROFILE",			true},	
	{"SQLCOM_SHOW_PROFILES",		true},	
};		

const int errorInfo[] = 
{
	ER_DISK_FULL,
	ER_SERVER_SHUTDOWN,
	ER_RECORD_FILE_FULL,
	ER_CANT_OPEN_LIBRARY,
	ER_CANT_FIND_DL_ENTRY,
	ER_HOST_IS_BLOCKED,
	ER_CANT_CREATE_THREAD,
	ER_TOO_MANY_USER_CONNECTIONS,
	ER_CON_COUNT_ERROR,
	NIL,	//for end flag
};
#endif
